<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/include/page.jsp"%>
<div class="bjui-pageHeader"
	style="background-color: #fefefe; border-bottom: none;">
	<form method="post" 
		action="${rootPath }/back/admins/roleList.htm" data-toggle="ajaxsearch" 
		novalidate="novalidate">
		<fieldset>
			<legend style="font-weight: normal;">搜索：</legend>
			<div style="margin: 0; padding: 1px 5px 5px;">
				<span>关键字：</span>
				<input type="text" name="keyword" value="${requestScope.keyword }" class="form-control" size="15"> &nbsp;&nbsp;&nbsp;&nbsp; 
				<span>状态：</span>
		        <select name="status" data-toggle="selectpicker">
		            <option value="">全部</option>
		            <option value="1" ${requestScope.status == '1' ? 'selected' : '' }>启用</option>
					<option value="0" ${requestScope.status == '0' ? 'selected' : '' }>禁用</option>
		        </select>
				<span>时间：</span>
				<input name="st" value="${requestScope.st }" readonly="readonly" data-toggle="datepicker" data-pattern="yyyy-MM-dd HH:mm:ss" type="text">
				<input name="ed" value="${requestScope.ed }" readonly="readonly" data-toggle="datepicker" data-pattern="yyyy-MM-dd HH:mm:ss" type="text">
				&nbsp;&nbsp;&nbsp;&nbsp;
				<div class="btn-group">
					<button type="submit" class="btn-green" data-icon="search">开始搜索！</button>
					<button type="reset" class="btn-orange" data-icon="times">重置</button>
				</div>
			</div>
		</fieldset>
	</form>
</div>
<div class="bjui-pageContent">
	<div class="bjui-datagrid">
		<div class="datagrid-title">角色列表</div>
		<div class="datagrid-toolbar">
			<div class="btn-group" role="group">
				<a href="${rootPath }/back/admins/roleInsert.htm" data-toggle="navtab"
					data-options="{id:'roleInsert',title:'角色添加'}"
					type="button" class="btn btn-blue" data-icon="plus">
					<i class="fa fa-plus"></i> 添加
				</a>
				<a id="roleInfoA" href="${rootPath }/back/admins/roleUpdate.htm?rid="
					onclick="return editAOper('roleInfoA','roleInfo','角色查看')"
					type="button" class="btn btn-orange" data-icon="arrows">
					<i class="fa fa-arrows"></i> 查看
				</a>
				<a id="roleUpdateA" href="${rootPath }/back/admins/roleUpdate.htm?operType=updateInfo&rid="
					onclick="return editAOper('roleUpdateA','roleUpdate','角色更新')"
					type="button" class="btn btn-green" data-icon="edit">
					<i class="fa fa-edit"></i> 更新
				</a>
				<a id="menuTreeListA" href="${rootPath }/back/admins/menuTreeList.htm?rid="
					onclick="return editAOper('menuTreeListA','roleInfo','分配权限')"
					type="button" class="btn btn-orange" data-icon="arrows">
					<i class="fa fa-arrows"></i> 分配权限
				</a>
			</div>
		</div>
		<table class="table table-bordered" id="datagrid-test-filter">
			<thead>
				<tr>
					<th width="40">序号</th>
					<th width="20">Id</th>
					<th width="50">创建人</th>
					<th width="50">上次更新人</th>
					<th width="100">名称</th>
					<th width="50">状态</th>
					<th width="130">更新时间</th>
					<th width="130">发布时间</th>
				</tr>
			</thead>
			<tbody>
				<%--
					rel:每一行都有一个rel,不能重复
				 --%>
				<c:forEach items="${requestScope.roleList }" var="role" varStatus="stat">
					<tr did="${role.id }">
						<td>${stat.count }</td>
						<td>${role.id}</td>
						<td>${role.createAdmins.name}</td>
						<td>${role.updateAdmins.name}</td>
						<td>${role.name }</td>
						<td>${role.statusStr }</td>
						<td><fmt:formatDate value="${role.updateTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
						<td><fmt:formatDate value="${role.pubTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
						<%-- <td>
							<a href="${rootPath }/back/admins/roleUpdate.htm?operType=updateInfo&aid=${role.id}" data-toggle="navtab"
								data-options="{id:'roleUpdate',title:'角色更新'}"
								type="button" class="btn btn-green" data-icon="edit">
								<i class="fa fa-edit"></i> 更新
							</a>
						</td> --%>		
					</tr>
				</c:forEach>
			</tbody>
		</table>
		<div class="bjui-paging-box">
			<div class="paging-content">
				<div class="paging-box">
					<form id="roleListPageForm" method="post" 
						action="${rootPath }/back/admins/roleList.htm" data-toggle="ajaxsearch" 
						novalidate="novalidate">
						
						<%-- 搜索条件 --%>
						<input type="hidden" name="keyword" value="${requestScope.keyword }">
						<input type="hidden" name="status" value="${requestScope.status }">
						<input type="hidden" name="st" value="${requestScope.st }">
						<input type="hidden" name="ed" value="${requestScope.ed }">
						
						<ul class="pagination">
							<li class="page-total"><span title="总记录数/总页数">共${requestScope.pageInfoUtil.totalRecord }条/共${requestScope.pageInfoUtil.totalPage }页</span></li>
							<li class="page-first btn-nav">
								<a href="#" title="首页" onclick="return pageForm('roleListPageForm', 'roleListCurrentPage', '1', 'roleListPageSize','${requestScope.pageInfoUtil.pageSize }')">
									<i class="fa fa-step-backward"></i>
								</a>
							</li>
							<li class="page-prev btn-nav">
								<a href="#" title="上一页" onclick="return pageForm('roleListPageForm', 'roleListCurrentPage', '${requestScope.pageInfoUtil.prePage }', 'roleListPageSize','${requestScope.pageInfoUtil.pageSize }')">
									<i class="fa fa-backward"></i>
								</a>
							</li>
							<li class="page-next btn-nav">
								<a href="#" title="下一页" onclick="return pageForm('roleListPageForm', 'roleListCurrentPage', '${requestScope.pageInfoUtil.nextPage }', 'roleListPageSize','${requestScope.pageInfoUtil.pageSize }')">
									<i class="fa fa-forward"></i>
								</a>
							</li>
							<li class="page-last btn-nav">
								<a href="#" title="末页" onclick="return pageForm('roleListPageForm', 'roleListCurrentPage', '${requestScope.pageInfoUtil.totalPage }', 'roleListPageSize','${requestScope.pageInfoUtil.pageSize }')">
									<i class="fa fa-step-forward"></i>
								</a>
							</li>
							<li class="page-jumpto">
								<span class="page-input">
									第
									<input class="form-control input-sm-pages" size="5" id="roleListCurrentPage" name="currentPage" value="${requestScope.pageInfoUtil.currentPage }" type="text">
									页
								</span>
							</li>
							<li class="page-jumpto">
								<span class="page-input">
									每页
									<input class="form-control input-sm-pages" size="5" id="roleListPageSize" name="pageSize" value="${requestScope.pageInfoUtil.pageSize }" type="text">
									条
								</span>
							</li>
							<li class="page-jumpto">
								<span class="page-input">
									<input class="form-control input-sm-pages" type="submit" value="GO">
								</span>
							</li>
						</ul>
					</form>
				</div>
			</div>
		</div>
	</div>
</div>

<%@ include file="/common/include/common_js.jsp"%>